using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Configuration.Provider;


namespace Ajax.Logging
{
    [SuppressMessage("Microsoft.Design", "CA1010:CollectionsShouldImplementGenericInterface", Justification = "Collections should implement generic interface")]
    public class ExceptionLogProviderCollection : ProviderCollection
    {
        public new ExceptionLogProvider this[string name]
        {
            [DebuggerStepThrough()]
            get
            {
                return (ExceptionLogProvider)base[name];
            }
        }

        [DebuggerStepThrough()]
        [SuppressMessage("Microsoft.Globalization", "CA1303:DoNotPassLiteralsAsLocalizedParameters", Justification = "Assembly is not localized")]
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            if (!(provider is ExceptionLogProvider))
            {
                throw new ArgumentException("Invalid provider type", "provider");
            }

            base.Add(provider);
        }
    }
}
